package learningThread.syn.synchronizedMethodLockObj.communicate.pipeStream;

import java.io.IOException;
import java.io.PipedOutputStream;

public class WriteData {

    public void writeMethod(PipedOutputStream out){
        try {
            System.out.println("Write :");
            for (int i = 0; i < 300; i++) {
                String outdata = ""+(i+1);
                out.write(outdata.getBytes());
                System.out.println(outdata);
            }
            System.out.println("");
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
